<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK href="<?=$this->styleurl?>/images/index.css" type=text/css rel=stylesheet />
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 CALLPADDING="0">
   <TBODY>
	  <TR BORDER="0" WIDTH="100%">
        <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top align=left bgColor=#ffffff height=30 colspan="4">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="34%" height="20"><img src="<?=$this->styleurl?>/images/url_01.gif" width="7" height="10" />&nbsp;<strong>文章列表</strong></td>
            <td height="20"><div align="right"><a href="<?=$this->baseUrl?>/admin/singlepage/addsp">添加</a>&nbsp;&nbsp;</div></td>
          </tr>
        </table>
        </TD>
      </TR>
	  <form id="form2" name="form2" method="post" action="">
	  <tr>
            <td height="20" bgcolor="#999999" style="PADDING-LEFT: 8px; PADDING-TOP: 8px"><input type="checkbox" name="selall" title="全选"  onClick="select_all('form2','ChkKindId[]',this.name)">&nbsp;</td>
            <td width="40%" bgcolor="#999999" style="PADDING-LEFT: 8px; PADDING-TOP: 8px"><span class="STYLE1">名称</span></td>
            <td width="16%" bgcolor="#999999" style="PADDING-LEFT: 8px; PADDING-TOP: 8px"><div align="center">发布日期</div></td>
            <td bgcolor="#999999"><div align="center">操作</div></td>
	  </tr>
		<?php 
	  	foreach ($this->sp_list as $row):
	  ?>
          <TR BORDER="0" WIDTH="100%" bgcolor="#EEEEEE" onmousemove="this.style.color='#000000';this.style.backgroundColor='#D5D5D5'" onmouseout="this.style.backgroundColor='#EEEEEE';this.style.color='#000000'">
            <TD width="6%"  height=25 align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px; border-bottom:#666666 dotted 1px;"><input name="ChkKindId[]" type="checkbox" id="ChkKindId[]" value="<?php echo $row["sp_id"];?>"  /></TD>
            <TD  height=25 align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px; border-bottom:#666666 dotted 1px;">
            <?php if(strlen($row["sp_title"])>60) echo mb_substr($row["sp_title"],0,30,"utf-8")."…"; else echo $row["sp_title"];?></TD>
            <TD align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center">
              <?php echo date('Y-m-d',$row["sp_date"]);?>
            </div></TD>
            <TD width="15%" align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center"><a href="<?=$this->adminurl?>/singlepage/editsp?id=<?=$row["sp_id"]?>">更改</a> 
            <a href="<?=$this->adminurl?>/singlepage/submitsp?id=<?=$row["sp_id"]?>">删除</a> <a href="#" target="_blank">查看</a></div></TD>
          </TR>
	  <?php 
	  endforeach;
	  ?>
</form>
 </TABLE>
</body>
</html>
<script language="JavaScript" >

function chkform(theForm,msg,action){
	if (confirm(msg)){

		document.forms[theForm].action.value = action;
		document.forms[theForm].submit();
		return true;
	}else{
		return false;
	}
}

// -------- 全選或取消 checkbox 方塊
<!--
function select_all(formName, elementName, selectAllName) {
	if(document.forms[formName].elements[selectAllName].checked) {
		
		if(document.forms[formName].elements[selectAllName].length = 1 &&
		    typeof(document.forms[formName].elements[elementName]) != "undefined" ) {
		
			document.forms[formName].elements[elementName].checked = true;

		    for(var i = 0; i < document.forms[formName].elements[elementName].length; i++)
			document.forms[formName].elements[elementName][i].checked = true;
		}
	}
	else {
		if(document.forms[formName].elements[selectAllName].length = 1 &&
		    typeof(document.forms[formName].elements[elementName]) != "undefined" ) {
			document.forms[formName].elements[elementName].checked = false;

		    for(var i = 0; i < document.forms[formName].elements[elementName].length; i++)
				document.forms[formName].elements[elementName][i].checked = false;
		}
	}
}
//-->

</script>